<?php
declare (strict_types = 1);

namespace app\admin\controller;

use app\admin\logic\BannerLogic;
use app\admin\model\Banner;
use app\BaseController;
use think\facade\Db;
use think\facade\Request;
use think\facade\View;

class Member extends BaseController {
    public function info()
    {
        return View::fetch();
    }
    public function pass()
    {
        return View::fetch();
    }
    //首页轮播列表
    public function adv()
    {
       $list=\app\admin\model\Banner::bannerList();
        View::assign('list',$list);
        return View::fetch();
    }
    //首页轮播添加
     public function  bannerAddInfo(){
        if (Request::isPost()){
            $post=Request::post();
            //首页轮播添加
            $data=BannerLogic::bannerAdd($post);
            list($res)=Banner::bannerAdd($data);
                if ($res){
                    $this->success('添加成功',url('adv'));
                }else{
                    $this->error('添加失败');
                }
        }else{
            return View::fetch();
        }

     }



}

